﻿Namespace Core.Controls
    Public Class StardustButton

        Public Shared ReadOnly BackBrushProperty As DependencyProperty =
            DependencyProperty.Register("BackBrush", GetType(Brush), GetType(StardustButton))

        Public Shared Shadows ReadOnly BorderBrushProperty As DependencyProperty =
            DependencyProperty.Register("BorderBrush", GetType(Brush), GetType(StardustButton))

        Public Event Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)

        Public Property Text As String
            Get
                Return TextBlock1.Text
            End Get
            Set(ByVal value As String)
                TextBlock1.Text = value
            End Set
        End Property
        Public Property Image As ImageSource
            Get
                Return Image1.Source
            End Get
            Set(ByVal value As ImageSource)
                Image1.Source = value
            End Set
        End Property

        Public Overloads Property Foreground As Brush
            Get
                Return TextBlock1.Foreground
            End Get
            Set(ByVal value As Brush)
                TextBlock1.Foreground = value
            End Set
        End Property

        Public Property BackBrush As Brush
            Get
                Return GetValue(BackBrushProperty)
            End Get
            Set(ByVal value As Brush)
                SetValue(BackBrushProperty, value)
            End Set
        End Property

        Public Shadows Property BorderBrush As Brush
            Get
                Return GetValue(BorderBrushProperty)
            End Get
            Set(ByVal value As Brush)
                SetValue(BorderBrushProperty, value)
            End Set
        End Property

        Public Sub New()

            ' This call is required by the designer.
            InitializeComponent()

            ' Add any initialization after the InitializeComponent() call.
            Me.DataContext = Me
        End Sub

        Private Sub Grid1_MouseLeftButtonDown(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
            RaiseEvent Click(sender, e)
        End Sub
    End Class
End Namespace
